﻿Imports MySql.Data.MySqlClient
Imports System.IO


Public Class main
    Public Path_SQL As String
    Dim mysql As MySqlConnection

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Add1Form As add1_1 = New add1_1(mysql)
        Add1Form.Show()
        Me.Close()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim Add2Form As addgroup2_1 = New addgroup2_1(mysql)
        Add2Form.Show()
        Me.Close()
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim Add3Form As personal3_1 = New personal3_1(mysql)
        Add3Form.Show()
        Me.Close()
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Dim NextForm As addpersonal = New addpersonal()
        NextForm.Show()
        Me.Close()
    End Sub

    Private Sub main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load




        mysql = New MySqlConnection
        mysql.ConnectionString = "server=127.0.0.1;port = 3306;user id=" + "root" + ";password=" + "software" + ";database=test;Character Set =utf8"

        'mysql.ConnectionString = "Server=172.26.8.182;Database=testremote;Uid=root;Pwd=software;CharSet=UTF8;"
        Try
            mysql.Open()
            '    MsgBox("CONNECTED TO DATABASE")
        Catch ex As Exception
            MsgBox("Can't Connect to database" + ex.Message)

            Me.Close()
        End Try
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Dim GroupReport As GroupReport4_1 = New GroupReport4_1(mysql)
        GroupReport.Show()

        Me.Close()
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Dim Addnewpersonal As add_Presonal5_1 = New add_Presonal5_1(mysql)
        Addnewpersonal.Show()

        Me.Close()
    End Sub


    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        Dim NextForm As DB = New DB()
        NextForm.Show()
    End Sub
End Class
